clear 
cd "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata"
use "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata\stata_replication.dta"

xtset ccode year

xtpcse v2xps_party i.gwf_prior c.reactive##c.pi4 prior_pi v2x_polyarchy lgdp fsu ussr_sat av_dm, pairwise


* Run the margins command
 margins, dydx (reactive) at (pi4=(0(0.01)1)) saving("margins5.1.dta", replace)
 
 
clear 
use "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata\stata_replication.dta"

xtset ccode year

xtpcse v2xps_party i.gwf_prior c.reactive##c.pi4 prior_pi v2x_polyarchy lgdp fsu ussr_sat av_dm, pairwise


* Run the margins command
 margins, dydx(pi4) at(reactive=(0 1)) saving("margins5.2.dta", replace)
 
 
